package advanced.practice._1008;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int l1=scanner.nextInt();
        int[]S1=new int[l1];
        for(int i=0;i<l1;i++){
            S1[i]=scanner.nextInt();
        }

        int l2=scanner.nextInt();
        int[]S2=new int[l2];
        for(int i=0;i<l2;i++){
            S2[i]=scanner.nextInt();
        }

        int target=(l1+l2+1)/2;

        int cnt=0;
        for(int i=0,j=0;i<l1&&j<l2;){
            int s1=S1[i];
            int s2=S2[j];

            cnt++;

            if(s1<s2){
                if(cnt==target){
                    System.out.print(s1);
                    break;
                }
                i++;
            }else{
                if(cnt==target){
                    System.out.print(s2);
                    break;
                }
                j++;
            }
        }
    }
}
